package com.example.springkafka;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.kafka.config.TopicBuilder;

/**
 * @author lenovo
 */
@SpringBootApplication
public class SpringKafkaApplication {
    //Topic的名字
//    public static final String TOPIC_NAME = "topic-test";

    //通过定义Bean的方式创建Topic
//    @Bean
//    public NewTopic topicHello(){
//        //创建Topic : topic名字， partition数量 , replicas副本数量
//        return TopicBuilder.name(TOPIC_NAME).build();
//    }


    public static void main(String[] args) {
        SpringApplication.run(SpringKafkaApplication.class, args);
    }

}
